package org.dromara.pay.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.math.BigDecimal;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import org.dromara.starter.jpacomment.annotation.SailColumn;
import org.dromara.starter.jpacomment.annotation.SailIndex;
import org.dromara.starter.jpacomment.annotation.SailTable;
import org.dromara.starter.jpacomment.enums.IndexType;
/**
 * 订单对象 pay_activity_order
 *
 * @author yf
 * @date 2024-07-22
 */

@Data
@TableName("pay_activity_order")
@Entity
@Table(name = "pay_activity_order")
@SailTable(comment = "订单表", indexs = {
    @SailIndex(name = "idx_order_date", type = IndexType.BTREE,
       columns = {"create_time"}
    ),    @SailIndex(name = "idx_pickup_point_id", type = IndexType.BTREE,
       columns = {"activity_registration_id"}
    ),    @SailIndex(name = "idx_customer_id", type = IndexType.BTREE,
       columns = {"create_by"}
    )}
)
public class PayActivityOrder implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;
    public static final String TRANS_ID_TO_OBJECT = "pay_activity_order_id_to_object";
    /**
     * 订单ID
     */
    @TableId(value = "order_id", type = IdType.AUTO)
    @Id
    private Integer orderId;
    /**
     * 订单名称
     */
    @Column(name = "subject")
    @SailColumn(comment = "订单名称",type = "varchar(12)", defaultValue = "NULL")
    private String subject;
    /**
     * 创建人wx_user（西湖论剑用户）
     */
    @SailColumn(comment = "创建人wx_user（西湖论剑用户）",type = "int", defaultValue = "NULL")
    @Column(name = "create_by")
    private Integer createBy;
    /**
     * 活动报名ID
     */
    @SailColumn(comment = "活动报名ID",type = "int", defaultValue = "NULL")
    @Column(name = "activity_registration_id")
    private Integer activityRegistrationId;
    /**
     * 总金额
     */
    @Column(name = "total_amount")
    @SailColumn(comment = "总金额",type = "decimal(10,2)", defaultValue = "NULL")
    private BigDecimal totalAmount;
    /**
     * 联系电话
     */
    @Column(name = "contact_phone")
    @SailColumn(comment = "联系电话",type = "varchar(20)", defaultValue = "NULL")
    private String contactPhone;
    /**
     * 付款方式（0=支付宝，1=微信支付，2=银联）
     */
    @Column(name = "payment_method")
    @SailColumn(comment = "付款方式（0=支付宝，1=微信支付，2=银联）",type = "varchar(50)", defaultValue = "NULL")
    private String paymentMethod;
    /**
     * 订单状态（0=未支付，1=已支付）
     */
    @Column(name = "order_status")
    @SailColumn(comment = "订单状态（0=未支付，1=已支付）",type = "char(1)", defaultValue = "NULL")
    private String orderStatus;
    /**
     * 到场二维码图片
     */
    @Column(name = "qr_code_image")
    @SailColumn(comment = "到场二维码图片",type = "text", defaultValue = "NULL")
    private String qrCodeImage;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Column(name = "create_time")
    @SailColumn(comment = "创建时间",type = "datetime", defaultValue = "CURRENT_TIMESTAMP")
    private Date createTime;
    /**
     * 删除标记
     */
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    @Column(name = "del_flag")
    @SailColumn(comment = "删除标记",type = "char(1)", defaultValue = "0")
    private String delFlag;
}
